<?php	
	require_once('paths.inc');
	require_once('page.inc');
	require_once(DB_PATH.'db.inc');	
	require_once(INCLUDE_PATH.'constants.inc');
	require_once('utils.inc');
	
	session_start();
	checkIsLoggedIn();
	select_language();
	
	$db = db_connect();
    
	$user = User::queryLoad($db, $_SESSION['user_logat']->id_user);
	$cols = explode(',', $user->coloane_firme);
	$tip_raspuns = $_GET['tip'];
	
?>
	<table align="center" cellpadding="2" cellspacing="2" border="0" id="wrapper2">
		<thead>
			<tr>
				<th colspan="4" align="center">
					<?php echo LANG_Chose_custom_fields; ?>
				</th>
			</tr>
		</thead>
		<tr class="capTabel">
			<td>
				<input disabled <?php echo "checked=\"checked\""; ?> type="checkbox" name="numef" id="numef" />
				<label for="numef"><?php echo LANG_NUME; ?></label>
			</td>
			<td>
				<input <?php if (in_array("cf", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="cf" id="cf" />
				<label for="cf"><?php echo LANG_CF; ?></label>
			</td>
            <td>
                <input <?php if (in_array("rc", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="rc" id="rc" />
                <label for="rc"><?php echo LANG_RC; ?></label>
            </td>
            <td>
                <input <?php if (in_array("tel_fix", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="tel_fix" id="tel_fix" />
                <label for="tel_fix"><?php echo LANG_TEL_FIX; ?></label>
            </td>
		</tr>
		<tr class="capTabel">
			<td>
				<input <?php if (in_array("tel_mobil", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="tel_mobil" id="tel_mobil" />
				<label for="tel_mobil"><?php echo LANG_TEL_MOBIL; ?></label>
			</td>
			<td>
				<input <?php if (in_array("email", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="email" id="email" />
				<label for="email"><?php echo LANG_EMAIL; ?></label>
			</td>
			<td>
				<input <?php if (in_array("web", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="web" id="web" />
				<label for="web"><?php echo LANG_WEB; ?></label>
			</td>
			<td>
				<input <?php if (in_array("tel_fax", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="tel_fax" id="tel_fax" />
				<label for="tel_fax"><?php echo LANG_TEL_FAX; ?></label>
			</td>
		</tr>
		<tr class="capTabel">
			<td>
				<input <?php if (in_array("tip", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="tip" id="tip" />
				<label for="tip"><?php echo LANG_tip; ?></label>
			</td>
			<td>
				<input <?php if (in_array("tara", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="tara" id="tara" />
				<label for="tara"><?php echo LANG_TARA; ?></label>
			</td>
			<td>
				<input <?php if (in_array("oras", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="oras" id="oras" />
				<label for="oras"><?php echo LANG_ORAS; ?></label>
			</td>
			<td>
				<input <?php if (in_array("Calitate_firma", $cols)) echo "checked=\"checked\""; ?> type="checkbox" name="calitate_firma" id="calitate_firma" />
				<label for="calitate_firma"><?php echo LANG_Calitate_firma; ?></label>
			</td>
		</tr>
		<tr class="capTabel">
			<td align="center" colspan="4">
				<input onclick="javascript: save_custom_fields_firma('<?php echo $tip_raspuns; ?>');" type="button" value="<?php echo LANG_Chose_custom_fields; ?>" />&nbsp;&nbsp;
				<input onclick="javascript: closeMessage();" type="button" value="<?php echo LANG_Close; ?>" />
			</td>
		</tr>
        <?php echo output_extra_text_modal(LANG_EXTRA_MODAL_FIRME_CUSTOM_TABLE, 4); ?>
	</table>
<?php
	flush();
?>